const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('con_check_info', {
    conslicemasterId: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "施工项目ID",
      field: 'conslicemaster_id'
    },
    createTime: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "创建时间",
      field: 'create_time'
    },
    createUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'create_user'
    },
    updateTime: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'update_time'
    },
    updateUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      field: 'update_user'
    },
    isDeleted: {
      type: DataTypes.BOOLEAN,
      allowNull: true,
      comment: "1删除 0未删除",
      field: 'is_deleted'
    },
    fileId: {
      type: DataTypes.STRING(125),
      allowNull: true,
      comment: "附件ID",
      field: 'file_id'
    },
    state: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "检查是否通过状态 红R 黄Y 绿G"
    },
    rectificationPeriod: {
      type: DataTypes.STRING(4),
      allowNull: true,
      comment: "整改期限 3、5、7天",
      field: 'rectification_period'
    },
    isPunish: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "是否处罚：1已处罚；0未处罚",
      field: 'is_punish'
    },
    handleResult: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "整改结果描述",
      field: 'handle_result'
    },
    isHandle: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "是否已整改：1已整改；0未整改",
      field: 'is_handle'
    },
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "唯一标识"
    }
  }, {
    sequelize,
    tableName: 'con_check_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
